import { Suspense } from 'react';
import { BrowserRouter, useRoutes } from 'react-router-dom';
import PageLoading from '../components/loading/page-loading';
import { routes } from './routes';

export default function Router() {
  const Outlet = () => useRoutes(routes);
  return (
    <Suspense fallback={<PageLoading />}>
      <BrowserRouter>
        <Outlet />
      </BrowserRouter>
    </Suspense>
  );
}
